<template>
  <div class="box">
    <div class="box-head">
      <div class="title">{{title}}</div>
    </div>
    <div class="box-content">
      <slot>
        <div class="not-data">暂无数据</div>
      </slot>
    </div>
    <div class="box-footer">
      <div class="btn-group">
        <el-button size="mini" @click="Cancel">取消</el-button>
        <el-button size="mini" @click="Save">保存</el-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: '默认'
    }

  },
  setup(props, ctx) {
    const Cancel = () => {
      ctx.emit('Cancel')
    }
    const Save = () => {
      ctx.emit('Save')
    }
    return {
      Cancel,
      Save,
    }
  }
}
</script>

<style lang="scss" scoped>
.box {
  width: 100%;
  border: 2px solid $mainColor;
  background: white;
  .box-head {
    height: 48px;
    width: 100%;
    line-height: 48px;
    border-bottom: 2px solid #e6e6e6;
    .title {
      padding-left: 20px;
      font-weight: 700;
    }
  }
  .box-content {
    padding: 10px 20px 10px 20px;
    .not-data {
      text-align: center;
      padding-top: 10px;
      color: #ccc;
    }
  }
  .box-footer {
    height: 48px;
    position: relative;
    background: white;
    width: 100%;
    line-height: 48px;
    .btn-group {
      position: absolute;
      right: 15%;
    }
  }
}
</style>